#import "QuenchIlluminateController.h"
        
#import "QuenchIlluminateModel.h"
#import "QuenchIlluminateCell.h"
#import "Masonry.h"

@interface QuenchIlluminateController () <UITableViewDataSource, UITableViewDelegate>

@property (nonatomic, strong) UITableView *sereneTableView;
@property (nonatomic, strong) NSMutableArray *solarArr;

@end

@implementation QuenchIlluminateController

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
}

- (void)viewDidLoad {
    [super viewDidLoad];

    [self vortexInitui];
	[self unfoldBreezefetchData];
}


//: 懒加载数据模型数组
- (NSMutableArray *)solarArr {
	if (!_solarArr) {
		_solarArr = [NSMutableArray array];
	}
	return _solarArr;
}

- (UITableView *)figHandleTableView {
    if (!_sereneTableView) {
        _sereneTableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain];
        _sereneTableView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
        _sereneTableView.estimatedRowHeight = 0;
        _sereneTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
        _sereneTableView.contentInset = UIEdgeInsetsMake(16, 0, 16, 0);
        _sereneTableView.delegate = self;
        _sereneTableView.dataSource = self;
        _sereneTableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
        _sereneTableView.showsVerticalScrollIndicator = NO;
        _sereneTableView.showsHorizontalScrollIndicator = NO;
        _sereneTableView.backgroundColor = UIColor.clearColor;
    }
    return _sereneTableView;
}

//: 初始化页面UI
- (void)vortexInitui {

	[self.view addSubview:self.sereneTableView];
	[self.sereneTableView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.leading.trailing.equalTo(self.view);
		make.top.equalTo(self.view);
		make.bottom.equalTo(self.view.mas_safeAreaLayoutGuideBottom);
	}];
}


//: 获取数据模型
- (void)unfoldBreezefetchData {
	
}

#pragma mark - UITableView DataSource 
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.solarArr.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    QuenchIlluminateCell *curiosityResilient = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([QuenchIlluminateCell class])];
    if (curiosityResilient == nil) {
        curiosityResilient = [[QuenchIlluminateCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:NSStringFromClass([QuenchIlluminateCell class])];
    }
    curiosityResilient.selectionStyle = UITableViewCellSelectionStyleNone;
    
    return curiosityResilient;
}


#pragma mark - UITableView Delegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    // cell tap action
}


@end
